﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rvt2ifcTool.Common
{
	public class ViewerConfig
	{
		public List<double> backgroundColor { get; set; }
		public string objectColorSource { get; set; }
		public bool externalMetadata { get; set; }
		public bool scaleCanvasResolution { get; set; }
	}

	public class ViewerContent
	{
		public List<string> modelsLoaded { get; set; }
	}

	public class ViewerState
	{
		public bool viewCubeEnabled { get; set; }
		public bool threeDEnabled { get; set; }
		public string tabOpen { get; set; }
	}

	public class Model
	{
		public string id { get; set; }
		public string name { get; set; }
		public bool saoEnabled  = true;
	}

	public class Xeokit
	{
		public Xeokit()
		{
			//Id = "Factory";
			//Name = "Factory";
			models = new List<Model>();
			//	{
			//		new Model { Id = "structure", Name = "Factory Structure", SaoEnabled = true },
			//		new Model { Id = "changdi", Name = "Factory Changdi", SaoEnabled = true }
			//	};
			viewerConfigs = new ViewerConfig
			{
				backgroundColor = new List<double> { 0.9, 0.9, 1.0 },
				objectColorSource = "model",
				externalMetadata = true,
				scaleCanvasResolution = true
			};
			viewerContent = new ViewerContent
			{
				modelsLoaded = new List<string>()
			};
			viewerState = new ViewerState
			{
				viewCubeEnabled = true,
				threeDEnabled = true,
				tabOpen = "models"
			};

			//string json = JsonConvert.SerializeObject(factory, Formatting.Indented);
		}
		public string id { get; set; }
		public string name { get; set; }
		public List<Model> models { get; set; }
		public ViewerConfig viewerConfigs { get; set; }
		public ViewerContent viewerContent { get; set; }
		public ViewerState viewerState { get; set; }
	}
}
